Allows to exchange strings with external code.
More...
|
const char * | _data |
| The data pointer over the string.
|
|
size_t | _size |
| The string's size.
|
|
Allows to exchange strings with external code.
The aim of this class is not to replace any std::string or std::string_view within a code base. It is intended to avoid passing the std templates, or relying on simple pointers when providing string information to logging capabilities. Note that all other components use nkMemory::StringView. However, as nkMemory depends on nkLog, this class has been introduced to help nkLog in this matter. A StringView is offered with many conversion functions, meaning you should never worry about it in the general use-case.
◆ StringView() [1/5]
nkLog::StringView::StringView |
( |
| ) |
|
|
delete |
◆ StringView() [2/5]
nkLog::StringView::StringView |
( |
const char * |
data | ) |
|
Simple pointer constructor. Will use strlen internally to derive its size.
- Parameters
-
data | The string pointer to create a view over. |
◆ StringView() [3/5]
nkLog::StringView::StringView |
( |
const char * |
data, |
|
|
size_t |
size |
|
) |
| |
Pointer and size constructor.
- Parameters
-
data | The string pointer to create a view over. |
size | The size of the string passed. |
◆ ~StringView()
nkLog::StringView::~StringView |
( |
| ) |
|
◆ StringView() [4/5]
nkLog::StringView::StringView |
( |
const std::string & |
str | ) |
|
Inlined standard string constructor. This function is inlined and thus will be fed by the client application, correctly addressing the templated class.
- Parameters
-
str | The string to create a view from. |
◆ StringView() [5/5]
nkLog::StringView::StringView |
( |
const std::string_view & |
str | ) |
|
Inlined standard string_view constructor. This function is inlined and thus will be fed by the client application, correctly addressing the templated class.
- Parameters
-
str | The view to create a view from. |
◆ operator std::string_view()
nkLog::StringView::operator std::string_view |
( |
| ) |
const |
Inlined automatic conversion operator. Used to be able to create std::string_views from any client code.
The documentation for this class was generated from the following file: